package net.neiquan.neiquandemowithkf.fragment;

import android.view.View;
import android.widget.Button;

import com.baidu.location.BDLocation;


import net.neiquan.neiquandemowithkf.R;
import net.neiquan.neiquandemowithkf.utils.Tools;
import net.neiquanlib.base.AppBaseFragment;
import net.neiquanlib.utils.BaiduLocationUtils;
import net.neiquanlib.utils.LogC;
import net.neiquanlib.widget.CustomViewPager;

import java.util.ArrayList;
import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;


/**
 * 作者 : hjb
 * 时间 : 2016/4/25.
 */
public class TabTwoFragment extends AppBaseFragment {
    @InjectView(R.id.button)
    Button mButton;
    @InjectView(R.id.customViewPager)
    CustomViewPager mCustomViewPager;

    @Override
    public View initRootView() {
        rootView = mInflater.inflate(R.layout.frag_stores, null);
        ButterKnife.inject(this, rootView);
        return rootView;
    }

    @Override
    public void setViews() {
        setTitleTv("商家");
        setBackGone();
    }

    @Override
    public void initData() {
        List<String> images = new ArrayList<>();
        images.add("http://pic.58pic.com/58pic/13/56/99/88f58PICuBh_1024.jpg");
        images.add("http://pic2.ooopic.com/12/18/64/98bOOOPIC3d_1024.jpg");
        images.add("http://img.zcool.cn/community/0108dc554b934c000001bf72b25a9a.jpg");
        List<String> title = new ArrayList<>();
        title.add("夏天的味道，风轻无雨，只有骄阳炙烤着大地，连同我的思绪一起飘逸，一时找不到心灵的静谧");
        title.add("夏天的味道");
        title.add("勇敢的海鸥，乖巧的驯鹿，还有善良的蜘蛛夏洛，他们让那些原本苍白单调的梦境美好得如同一个个精致的蝴蝶标本。");
        mCustomViewPager.setImageUris(images, null);
    }


    @OnClick(R.id.button)
    public void onClick() {
        BaiduLocationUtils.getInstence(Tools.getContext()).requestLocation(new BaiduLocationUtils.LocationCallBck() {
            @Override
            public void onSuccess(double longitude, double latitude, String city, BDLocation location) {
                LogC.e("定位成功,您所在的城市:" + city + "坐标 经度:" + longitude + "  纬度:" + latitude);
            }

            @Override
            public void onFail() {

            }
        });
    }
}
